<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>电商提示词生成器 - 专业版</title>
    
    <!-- PWA相关配置 -->
    <meta name="theme-color" content="#008c8c">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="apple-mobile-web-app-title" content="提示词生成器">
    
    <!-- 应用图标链接 -->
    <link rel="icon" type="image/png" href="icons/icon-32x32.png" sizes="32x32">
    <link rel="icon" type="image/png" href="icons/icon-192x192.png" sizes="192x192">
    <link rel="apple-touch-icon" href="icons/icon-180x180.png">
    
    <!-- Web应用清单 -->
    <link rel="manifest" href="manifest.json">
    
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary-color: #008c8c;
            --primary-light: #00a8a8;
            --primary-dark: #006b6b;
            --secondary-color: #f0f7f7;
            --text-color: #333;
            --text-light: #666;
            --background-color: #fff;
            --border-color: #c8e1e1;
            --success-color: #28a745;
            --warning-color: #ffc107;
            --danger-color: #e74c3c;
            --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            --radius: 10px;
        }
        
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
        }
        
        body {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
            color: var(--text-color);
            line-height: 1.6;
            padding: 20px;
            min-height: 100vh;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: var(--background-color);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            overflow: hidden;
        }
        
        header {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
            color: white;
            padding: 30px 20px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }
        
        header::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
            background-size: cover;
        }
        
        h1 {
            font-size: 32px;
            margin-bottom: 10px;
            position: relative;
        }
        
        .subtitle {
            font-size: 16px;
            opacity: 0.9;
            position: relative;
        }
        
        .tabs {
            display: flex;
            background: var(--secondary-color);
            border-bottom: 1px solid var(--border-color);
            position: relative;
        }
        
        .tab {
            flex: 1;
            padding: 18px;
            text-align: center;
            cursor: pointer;
            font-weight: bold;
            transition: all 0.3s;
            border-bottom: 3px solid transparent;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        
        .tab.active {
            background: var(--background-color);
            border-bottom: 3px solid var(--primary-color);
            color: var(--primary-color);
        }
        
        .tab:hover:not(.active) {
            background: rgba(255, 255, 255, 0.7);
        }
        
        .tab-content {
            display: none;
            padding: 30px;
            animation: fadeIn 0.5s ease;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        .tab-content.active {
            display: block;
        }
        
        .form-group {
            margin-bottom: 25px;
        }
        
        label {
            display: block;
            margin-bottom: 10px;
            font-weight: bold;
            color: var(--text-color);
            font-size: 16px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        select, input, textarea {
            width: 100%;
            padding: 14px 16px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-size: 16px;
            background-color: #f9f9f9;
            transition: all 0.3s;
        }
        
        select:focus, input:focus, textarea:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(0, 140, 140, 0.2);
            background-color: #fff;
        }
        
        .attributes-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
        }
        
        .attribute-group {
            background: #f8f9fa;
            padding: 18px;
            border-radius: 10px;
            border: 1px solid #e9ecef;
            transition: all 0.3s;
        }
        
        .attribute-group:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }
        
        button {
            background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
            color: white;
            border: none;
            padding: 16px 25px;
            font-size: 18px;
            border-radius: 8px;
            cursor: pointer;
            width: 100%;
            font-weight: bold;
            transition: transform 0.2s, box-shadow 0.2s;
            margin-top: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }
        
        button:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 140, 140, 0.3);
        }
        
        button:active {
            transform: translateY(0);
        }
        
        .result-container {
            margin-top: 25px;
            padding: 25px;
            background-color: #f8f9fa;
            border-radius: 8px;
            display: none;
            border-left: 4px solid var(--primary-color);
        }
        
        .result-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }
        
        .copy-btn {
            background: var(--success-color);
            width: auto;
            padding: 10px 18px;
            font-size: 14px;
        }
        
        textarea {
            width: 100%;
            height: 200px;
            padding: 15px;
            border: 1px solid #ddd;
            border-radius: 8px;
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 14px;
            resize: vertical;
            background-color: #f1f3f4;
        }
        
        footer {
            text-align: center;
            padding: 20px;
            color: var(--text-light);
            font-size: 14px;
            border-top: 1px solid #eee;
            background: #f9f9f9;
        }
        
        .char-count {
            font-size: 12px;
            color: var(--text-light);
            text-align: right;
            margin-top: 5px;
        }
        
        .char-count.warning {
            color: var(--danger-color);
            font-weight: bold;
        }
        
        .example-btn {
            background: #5a8d8d;
            color: white;
            border: none;
            padding: 8px 15px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.3s;
        }
        
        .example-btn:hover {
            background: #4a7d7d;
        }
        
        .mode-settings {
            background: #e8f4f4;
            border: 1px solid #b8d4d4;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 25px;
        }
        
        .mode-settings h3 {
            color: var(--primary-dark);
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .mode-settings p {
            color: var(--primary-dark);
            font-size: 14px;
            margin-bottom: 10px;
        }
        
        .checkbox-group {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
        }
        
        .checkbox-group input[type="checkbox"] {
            width: 20px;
            height: 20px;
            accent-color: var(--primary-color);
        }
        
        .batch-section {
            background: var(--secondary-color);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 25px;
        }
        
        .batch-section h3 {
            color: var(--primary-dark);
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .batch-controls {
            display: flex;
            gap: 10px;
            margin-top: 15px;
        }
        
        .batch-controls select {
            flex: 1;
        }
        
        .batch-results {
            margin-top: 20px;
            display: none;
        }
        
        .batch-result-item {
            background: white;
            border: 1px solid #ddd;
            border-radius: 5px;
            padding: 15px;
            margin-bottom: 15px;
            transition: all 0.3s;
        }
        
        .batch-result-item:hover {
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
        }
        
        .batch-result-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            align-items: center;
        }
        
        .batch-copy-btn {
            background: #5a8d8d;
            color: white;
            border: none;
            padding: 6px 12px;
            border-radius: 3px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.3s;
        }
        
        .batch-copy-btn:hover {
            background: #4a7d7d;
        }
        
        .batch-prompt {
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 12px;
            white-space: pre-wrap;
            line-height: 1.5;
        }
        
        .detail-images-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 20px;
            margin-top: 15px;
        }
        
        .detail-image-item {
            background: #f8f9fa;
            padding: 18px;
            border-radius: 8px;
            border: 1px solid #e9ecef;
            transition: all 0.3s;
        }
        
        .detail-image-item:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }
        
        .video-steps {
            display: flex;
            flex-direction: column;
            gap: 20px;
            margin-top: 15px;
        }
        
        .video-step {
            background: #f8f9fa;
            padding: 18px;
            border-radius: 8px;
            border: 1px solid #e9ecef;
            transition: all 0.3s;
        }
        
        .video-step:hover {
            transform: translateY(-3px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }
        
        .step-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
            align-items: center;
        }
        
        .step-duration {
            font-size: 14px;
            color: var(--text-light);
            background: var(--primary-light);
            color: white;
            padding: 3px 8px;
            border-radius: 4px;
        }
        
        .realism-toggle {
            background: #e8f4f4;
            border: 1px solid #b8d4d4;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 25px;
        }
        
        .realism-toggle h3 {
            color: var(--primary-dark);
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .preview-section {
            background: #f0f7f7;
            border: 1px solid #c8e1e1;
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 25px;
            display: none;
        }
        
        .preview-section h3 {
            color: var(--primary-dark);
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .preview-content {
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 14px;
            white-space: pre-wrap;
            line-height: 1.6;
            background: white;
            padding: 15px;
            border-radius: 5px;
            border: 1px solid #ddd;
            max-height: 300px;
            overflow-y: auto;
        }
        
        .history-section {
            background: #f8f9fa;
            border: 1px solid #e9ecef;
            border-radius: 8px;
            padding: 20px;
            margin-top: 25px;
            display: none;
        }
        
        .history-section h3 {
            color: var(--primary-dark);
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .history-list {
            max-height: 200px;
            overflow-y: auto;
        }
        
        .history-item {
            background: white;
            border: 1px solid #ddd;
            border-radius: 5px;
            padding: 10px;
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .history-content {
            flex: 1;
            font-family: 'Consolas', 'Monaco', monospace;
            font-size: 12px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .history-actions {
            display: flex;
            gap: 5px;
        }
        
        .history-btn {
            background: #5a8d8d;
            color: white;
            border: none;
            padding: 3px 8px;
            border-radius: 3px;
            cursor: pointer;
            font-size: 12px;
        }
        
        @media (max-width: 768px) {
            .attributes-grid, .detail-images-grid {
                grid-template-columns: 1fr;
            }
            
            body {
                padding: 10px;
            }
            
            .batch-controls {
                flex-direction: column;
            }
            
            .tabs {
                flex-direction: column;
            }
            
            .tab {
                padding: 15px;
            }
            
            .tab-content {
                padding: 20px;
            }
            
            .step-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 5px;
            }
            
            .history-item {
                flex-direction: column;
                align-items: flex-start;
                gap: 10px;
            }
            
            .history-actions {
                align-self: flex-end;
            }
        }

        /* 安装提示样式 */
        #installPrompt {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: white;
            border-radius: 10px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.2);
            padding: 15px;
            z-index: 1000;
            max-width: 300px;
            display: none;
        }
        
        #installPrompt p {
            margin-bottom: 10px;
        }
        
        #installPrompt button {
            width: auto;
            margin: 5px;
            padding: 8px 15px;
        }
        
        #closeInstallPrompt {
            background: #999;
        }
    </style>
</head>
<body>
    <div class="container">
        <header>
            <h1><i class="fas fa-robot"></i> 电商提示词生成器</h1>
            <p class="subtitle">5分钟上传一条精准链接 · 主图 · 详情页 · 视频 · 一站式解决方案</p>
        </header>
        
        <div class="tabs">
            <div class="tab active" data-tab="main">
                <i class="fas fa-image"></i> 主图提示词
            </div>
            <div class="tab" data-tab="detail">
                <i class="fas fa-images"></i> 详情页提示词
            </div>
            <div class="tab" data-tab="video">
                <i class="fas fa-video"></i> 产品视频提示词
            </div>
        </div>
        
        <!-- 主图提示词生成器 -->
        <div id="main-tab" class="tab-content active">
            <div class="form-container">
                <!-- 真实感增强模式 -->
                <div class="realism-toggle">
                    <div class="checkbox-group">
                        <input type="checkbox" id="realismMode" checked>
                        <label for="realismMode"><i class="fas fa-camera"></i> 开启真实感增强模式</label>
                    </div>
                    <p><small>此模式会使用更自然的摄影描述，避免过于完美的AI效果</small></p>
                </div>
                
                <div class="form-group">
                    <label for="productSubject">
                        <i class="fas fa-cube"></i> 产品主体 
                        <button type="button" class="example-btn" onclick="fillExample()"><i class="fas fa-magic"></i> 填充示例</button>
                    </label>
                    <input type="text" id="productSubject" placeholder="例如：陶瓷花瓶、手工香薰蜡烛、复古手表...">
                </div>
                
                <div class="attributes-grid">
                    <div class="attribute-group">
                        <label for="style"><i class="fas fa-palette"></i> 风格</label>
                        <select id="style">
                            <option value="">-- 选择风格 --</option>
                            <option value="new Chinese style">新中式</option>
                            <option value="Nordic style">北欧风</option>
                            <option value="cyberpunk">赛博朋克</option>
                            <option value="pop art">波普艺术</option>
                            <option value="minimalism">极简主义</option>
                            <option value="retro-futurism">复古未来主义</option>
                        </select>
                    </div>
                    
                    <div class="attribute-group">
                        <label for="composition"><i class="fas fa-crop-alt"></i> 构图</label>
                        <select id="composition">
                            <option value="">-- 选择构图 --</option>
                            <option value="overhead shot">俯拍</option>
                            <option value="45-degree angle">45度角</option>
                            <option value="front close-up">正面特写</option>
                            <option value="rule of thirds">三分法</option>
                            <option value="symmetrical composition">对称构图</option>
                            <option value="floating composition">悬浮构图</option>
                        </select>
                    </div>
                    
                    <div class="attribute-group">
                        <label for="lighting"><i class="fas fa-lightbulb"></i> 光影</label>
                        <select id="lighting">
                            <option value="">-- 选择光影 --</option>
                            <option value="morning light">晨光</option>
                            <option value="side light">侧光</option>
                            <option value="softbox light">柔光箱</option>
                            <option value="backlight">逆光</option>
                            <option value="volumetric light">体积光</option>
                            <option value="cyber neon">赛博霓虹灯</option>
                        </select>
                    </div>
                    
                    <div class="attribute-group">
                        <label for="color"><i class="fas fa-fill-drip"></i> 色彩</label>
                        <select id="color">
                            <option value="">-- 选择色彩 --</option>
                            <option value="Morandi color palette">莫兰迪色系</option>
                            <option value="candy colors">糖果色</option>
                            <option value="black and gold">黑金配色</option>
                            <option value="warm cool contrast">冷暖对比</option>
                            <option value="monochrome minimalism">单色极简</option>
                        </select>
                    </div>
                    
                    <div class="attribute-group">
                        <label for="material"><i class="fas fa-texture"></i> 材质/质感</label>
                        <select id="material">
                            <option value="">-- 选择材质 --</option>
                            <!-- 服装纺织类 -->
                            <option value="cotton fabric">棉质面料</option>
                            <option value="soft knit">柔软针织</option>
                            <option value="silk texture">丝绸质感</option>
                            <option value="denim">牛仔布料</option>
                            <option value="wool">羊毛材质</option>
                            <!-- 数码产品类 -->
                            <option value="metal casing">金属外壳</option>
                            <option value="matte plastic">磨砂塑料</option>
                            <option value="glass screen">玻璃屏幕</option>
                            <option value="aluminum alloy">铝合金</option>
                            <!-- 家居日用类 -->
                            <option value="ceramic glaze">陶瓷釉面</option>
                            <option value="wood grain">木质纹理</option>
                            <option value="bamboo">竹材质</option>
                            <option value="stainless steel">不锈钢</option>
                            <!-- 美妆个护类 -->
                            <option value="plastic packaging">塑料包装</option>
                            <option value="glass bottle">玻璃瓶身</option>
                            <option value="cream texture">乳霜质地</option>
                            <!-- 食品类 -->
                            <option value="fresh ingredient">新鲜食材</option>
                            <option value="chocolate coating">巧克力涂层</option>
                            <option value="crispy texture">酥脆质感</option>
                        </select>
                    </div>
                    
                    <div class="attribute-group">
                        <label for="background"><i class="fas fa-mountain"></i> 背景</label>
                        <select id="background">
                            <option value="">-- 选择背景 --</option>
                            <!-- 纯色背景 -->
                            <option value="pure white background">纯白背景</option>
                            <option value="light gray background">浅灰背景</option>
                            <option value="pastel background">浅色系背景</option>
                            <!-- 电商常用场景 -->
                            <option value="studio backdrop">摄影棚背景</option>
                            <option value="lifestyle setting">生活场景</option>
                            <option value="home environment">家居环境</option>
                            <option value="office desk">办公桌面</option>
                            <!-- 自然场景 -->
                            <option value="outdoor natural light">户外自然光</option>
                            <option value="coffee shop">咖啡厅</option>
                            <option value="green plants background">绿植背景</option>
                            <!-- 电商专用 -->
                            <option value="product display shelf">产品陈列架</option>
                            <option value="minimalist setup">简约布置</option>
                            <option value="textured wall">纹理墙面</option>
                        </select>
                    </div>
                    
                    <div class="attribute-group">
                        <label for="mood"><i class="fas fa-cloud"></i> 氛围/情绪</label>
                        <select id="mood">
                            <option value="">-- 选择氛围 --</option>
                            <option value="serene">静谧</option>
                            <option value="healing">治愈</option>
                            <option value="mysterious">神秘</option>
                            <option value="tech feel">科技感</option>
                            <option value="fairy tale">童话感</option>
                            <option value="premium">高级感</option>
                            <option value="life atmosphere">生活气息</option>
                        </select>
                    </div>
                    
                    <div class="attribute-group">
                        <label for="details"><i class="fas fa-search-plus"></i> 细节增强</label>
                        <select id="details">
                            <option value="">-- 选择细节 --</option>
                            <option value="falling petals">花瓣飘落</option>
                            <option value="steam rising">蒸汽升腾</option>
                            <option value="dappled light">光影斑驳</option>
                            <option value="water droplets">水珠凝结</option>
                            <option value="smoke swirling">烟雾缭绕</option>
                            <option value="starlight">星光点缀</option>
                        </select>
                    </div>
                    
                    <div class="attribute-group">
                        <label for="aspectRatio"><i class="fas fa-expand"></i> 画幅比例</label>
                        <select id="aspectRatio">
                            <option value="">-- 选择画幅 --</option>
                            <option value="1:1">1:1（电商主图）</option>
                            <option value="3:2">3:2</option>
                            <option value="4:5">4:5（竖图）</option>
                            <option value="16:9">16:9（横幅）</option>
                            <option value="9:16">9:16（短视频封面）</option>
                        </select>
                    </div>
                    
                    <div class="attribute-group">
                        <label for="styleReference"><i class="fas fa-paint-brush"></i> 风格参考</label>
                        <select id="styleReference">
                            <option value="">-- 选择风格参考 --</option>
                            <option value="Chinese style illustration">国风插画</option>
                            <option value="Miyazaki style">宫崎骏画风</option>
                            <option value="cyber city">赛博城市</option>
                            <option value="MUJI style">MUJI风</option>
                            <option value="Vogue magazine">Vogue杂志风</option>
                            <option value="3D rendering">3D渲染</option>
                            <option value="photorealistic">摄影级写实</option>
                        </select>
                    </div>
                </div>
                
                <!-- 实时预览 -->
                <div id="previewSection" class="preview-section">
                    <h3><i class="fas fa-eye"></i> 提示词预览</h3>
                    <div id="previewContent" class="preview-content"></div>
                </div>
                
                <div class="form-group">
                    <label for="customInput"><i class="fas fa-edit"></i> 自定义描述（选填）</label>
                    <textarea id="customInput" placeholder="例如：模特穿着展示、特定场景描述、特殊效果要求等..."></textarea>
                </div>
                
                <!-- 批量生成区域 -->
                <div class="batch-section">
                    <h3><i class="fas fa-sync-alt"></i> 批量生成变体</h3>
                    <p>同时生成多个风格变体，测试不同组合效果</p>
                    <div class="batch-controls">
                        <select id="batchStyle">
                            <option value="">-- 选择风格组合 --</option>
                            <option value="new Chinese style,minimalism,cyberpunk">新中式/极简/赛博</option>
                            <option value="Nordic style,pop art,retro-futurism">北欧/波普/复古未来</option>
                        </select>
                        <select id="batchBackground">
                            <option value="">-- 选择背景组合 --</option>
                            <option value="pure white background,studio backdrop,lifestyle setting">纯白/摄影棚/生活场景</option>
                            <option value="home environment,coffee shop,outdoor natural light">家居/咖啡厅/户外</option>
                        </select>
                        <button id="batchGenerateBtn" class="copy-btn" style="width: auto;"><i class="fas fa-layer-group"></i> 批量生成</button>
                    </div>
                    <div id="batchResults" class="batch-results">
                        <h4>批量生成结果</h4>
                        <div id="batchResultList"></div>
                    </div>
                </div>
                
                <button id="generateBtn"><i class="fas fa-bolt"></i> 生成主图提示词</button>
                
                <div id="resultContainer" class="result-container">
                    <div class="result-header">
                        <h3><i class="fas fa-scroll"></i> 生成的主图提示词</h3>
                        <button id="copyBtn" class="copy-btn"><i class="fas fa-copy"></i> 复制到剪贴板</button>
                    </div>
                    <textarea id="promptResult" readonly></textarea>
                    <div id="charCount" class="char-count">字数：0</div>
                    <div style="margin-top: 10px; font-size: 13px; color: #666;">
                        <strong>使用说明：</strong> 在AI绘画工具中，先上传您的产品图片，然后将此提示词复制到描述框中。
                    </div>
                </div>
                
                <!-- 历史记录 -->
                <div id="historySection" class="history-section">
                    <h3><i class="fas fa-history"></i> 提示词历史记录</h3>
                    <div id="historyList" class="history-list"></div>
                </div>
            </div>
        </div>
        
        <!-- 详情页提示词生成器 -->
        <div id="detail-tab" class="tab-content">
            <div class="form-container">
                <div class="realism-toggle">
                    <div class="checkbox-group">
                        <input type="checkbox" id="detailRealismMode" checked>
                        <label for="detailRealismMode"><i class="fas fa-camera"></i> 开启真实感增强模式</label>
                    </div>
                    <p><small>此模式会使用更自然的摄影描述，避免过于完美的AI效果</small></p>
                </div>
                
                <div class="form-group">
                    <label for="detailProductSubject"><i class="fas fa-cube"></i> 产品主体</label>
                    <input type="text" id="detailProductSubject" placeholder="例如：陶瓷花瓶、手工香薰蜡烛、复古手表...">
                </div>
                
                <div class="form-group">
                    <label><i class="fas fa-th-large"></i> 详情页图片配置 (8张图片)</label>
                    <div class="detail-images-grid">
                        <div class="detail-image-item">
                            <label for="detailImage1">1. 主图展示</label>
                            <select id="detailImage1">
                                <option value="pure white background, front close-up, studio lighting, negative space for text">纯白背景 + 正面特写 + 留白</option>
                                <option value="lifestyle setting, 45-degree angle, natural light, space for text overlay">生活场景 + 45度角 + 文字空间</option>
                                <option value="textured wall, symmetrical composition, side light, area for text">纹理墙面 + 对称构图 + 文字区域</option>
                            </select>
                        </div>
                        <div class="detail-image-item">
                            <label for="detailImage2">2. 细节特写</label>
                            <select id="detailImage2">
                                <option value="macro shot, extreme close-up, softbox light, clear background for text">微距拍摄 + 极致特写 + 清晰背景</option>
                                <option value="texture detail, side light, shallow depth of field, text-friendly area">纹理细节 + 侧光 + 文字友好区域</option>
                                <option value="product logo, front close-up, studio lighting, space for description">产品标识 + 正面特写 + 描述空间</option>
                            </select>
                        </div>
                        <div class="detail-image-item">
                            <label for="detailImage3">3. 使用场景</label>
                            <select id="detailImage3">
                                <option value="home environment, lifestyle setting, natural light, blank area for text">家居环境 + 生活场景 + 留白区域</option>
                                <option value="office desk, working scene, warm lighting, space for text">办公桌面 + 工作场景 + 文字空间</option>
                                <option value="outdoor setting, natural environment, sunlight, area for text overlay">户外环境 + 自然光线 + 文字叠加区</option>
                            </select>
                        </div>
                        <div class="detail-image-item">
                            <label for="detailImage4">4. 尺寸展示</label>
                            <select id="detailImage4">
                                <option value="size comparison, with common objects, overhead shot, negative space">尺寸对比 + 常见物品 + 俯拍 + 留白</option>
                                <option value="measurement indicators, ruler included, top-down view, text area">测量标识 + 包含尺子 + 俯视图 + 文字区</option>
                                <option value="human hand for scale, close-up, natural light, space for text">人手对比 + 特写 + 自然光 + 文字空间</option>
                            </select>
                        </div>
                        <div class="detail-image-item">
                            <label for="detailImage5">5. 材质展示</label>
                            <select id="detailImage5">
                                <option value="texture close-up, macro photography, side light, clean background">材质特写 + 微距摄影 + 侧光 + 干净背景</option>
                                <option value="material details, high resolution, studio lighting, text-friendly area">材质细节 + 高分辨率 + 影棚灯光 + 文字友好区</option>
                                <option value="fabric texture, close-up, natural light, space for text">面料纹理 + 特写 + 自然光 + 文字空间</option>
                            </select>
                        </div>
                        <div class="detail-image-item">
                            <label for="detailImage6">6. 功能演示</label>
                            <select id="detailImage6">
                                <option value="in use, action shot, lifestyle setting, area for text">使用中 + 动作拍摄 + 生活场景 + 文字区域</option>
                                <option value="function demonstration, step by step, clear view, text space">功能演示 + 步骤展示 + 清晰视图 + 文字空间</option>
                                <option value="before and after, comparison, same background, negative space">前后对比 + 相同背景 + 留白</option>
                            </select>
                        </div>
                        <div class="detail-image-item">
                            <label for="detailImage7">7. 搭配推荐</label>
                            <select id="detailImage7">
                                <option value="with complementary products, styled arrangement, lifestyle setting, text area">搭配产品 + 精心布置 + 生活场景 + 文字区</option>
                                <option value="outfit coordination, fashion styling, full body shot, space for text">服装搭配 + 时尚造型 + 全身照 + 文字空间</option>
                                <option value="set collection, product grouping, aesthetic arrangement, text-friendly">套装集合 + 产品分组 + 美学布置 + 文字友好</option>
                            </select>
                        </div>
                        <div class="detail-image-item">
                            <label for="detailImage8">8. 品牌展示</label>
                            <select id="detailImage8">
                                <option value="brand logo prominent, clean background, professional, text space">品牌标识突出 + 干净背景 + 专业 + 文字空间</option>
                                <option value="packaging shot, unboxing style, studio lighting, area for text">包装展示 + 开箱风格 + 影棚灯光 + 文字区域</option>
                                <option value="brand story elements, subtle branding, lifestyle, text overlay area">品牌故事元素 + 生活化 + 文字叠加区</option>
                            </select>
                        </div>
                    </div>
                </div>
                
                <div class="form-group">
                    <label for="detailCustomInput"><i class="fas fa-edit"></i> 自定义描述（选填）</label>
                    <textarea id="detailCustomInput" placeholder="例如：特定卖点强调、特殊效果要求等..."></textarea>
                </div>
                
                <button id="generateDetailBtn"><i class="fas fa-bolt"></i> 生成详情页提示词</button>
                
                <div id="detailResultContainer" class="result-container">
                    <div class="result-header">
                        <h3><i class="fas fa-scroll"></i> 生成的详情页提示词</h3>
                        <button id="copyAllDetailBtn" class="copy-btn"><i class="fas fa-copy"></i> 复制全部</button>
                    </div>
                    <div id="detailPromptResults"></div>
                    <div id="detailCharCount" class="char-count">字数：0</div>
                    <div style="margin-top: 10px; font-size: 13px; color: #666;">
                        <strong>使用说明：</strong> 在AI绘画工具中，先上传您的产品图片，然后分别使用这些提示词生成8张详情页图片。
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 产品视频提示词生成器 -->
        <div id="video-tab" class="tab-content">
            <div class="form-container">
                <div class="mode-settings">
                    <h3><i class="fas fa-film"></i> 产品视频生成</h3>
                    <p>生成10-15秒产品视频提示词，确保产品一致性</p>
                </div>
                
                <div class="form-group">
                    <label for="videoProductSubject"><i class="fas fa-cube"></i> 产品主体</label>
                    <input type="text" id="videoProductSubject" placeholder="例如：陶瓷花瓶、手工香薰蜡烛、复古手表...">
                </div>
                
                <div class="form-group">
                    <label for="videoType"><i class="fas fa-play-circle"></i> 视频类型</label>
                    <select id="videoType">
                        <option value="product showcase">产品展示</option>
                        <option value="usage tutorial">使用教程</option>
                        <option value="lifestyle story">生活场景故事</option>
                        <option value="function demonstration">功能演示</option>
                    </select>
                </div>
                
                <div class="form-group">
                    <label for="videoStyle"><i class="fas fa-paint-brush"></i> 视频风格</label>
                    <select id="videoStyle">
                        <option value="minimalist and clean">简约干净</option>
                        <option value="dynamic and energetic">活力动感</option>
                        <option value="cinematic and premium">电影感高级</option>
                        <option value="warm and cozy">温馨舒适</option>
                    </select>
                </div>
                
                <div class="form-group">
                    <label><i class="fas fa-list-ol"></i> 视频结构 (10-15秒)</label>
                    <div class="video-steps">
                        <div class="video-step">
                            <div class="step-header">
                                <strong>开场镜头 (2-3秒)</strong>
                                <span class="step-duration">2-3秒</span>
                            </div>
                            <select id="videoStep1">
                                <option value="close-up of product with dramatic reveal">产品特写 + 戏剧性展示</option>
                                <option value="product in use within lifestyle context">生活场景中的产品使用</option>
                                <option value="problem statement then product solution">问题陈述 + 产品解决方案</option>
                            </select>
                        </div>
                        <div class="video-step">
                            <div class="step-header">
                                <strong>主体展示 (4-5秒)</strong>
                                <span class="step-duration">4-5秒</span>
                            </div>
                            <select id="videoStep2">
                                <option value="360-degree rotation showing all angles">360度旋转展示所有角度</option>
                                <option value="key features highlighted one by one">关键功能逐一突出展示</option>
                                <option value="smooth transitions between different uses">不同使用场景的流畅转换</option>
                            </select>
                        </div>
                        <div class="video-step">
                            <div class="step-header">
                                <strong>功能演示 (3-4秒)</strong>
                                <span class="step-duration">3-4秒</span>
                            </div>
                            <select id="videoStep3">
                                <option value="actual usage demonstration with hands">实际使用演示（含手部）</option>
                                <option value="before and after comparison">前后效果对比</option>
                                <option value="unique feature close-up and explanation">独特功能特写与说明</option>
                            </select>
                        </div>
                        <div class="video-step">
                            <div class="step-header">
                                <strong>结束镜头 (1-2秒)</strong>
                                <span class="step-duration">1-2秒</span>
                            </div>
                            <select id="videoStep4">
                                <option value="product hero shot with brand logo">产品英雄镜头 + 品牌标识</option>
                                <option value="call to action with product in frame">行动号召 + 产品在画面中</option>
                                <option value="lifestyle ending showing satisfaction">生活化结尾展示满意度</option>
                            </select>
                        </div>
                    </div>
                </div>
                
                <div class="form-group">
                    <label for="videoCustomInput"><i class="fas fa-edit"></i> 自定义描述（选填）</label>
                    <textarea id="videoCustomInput" placeholder="例如：特定功能强调、品牌元素、特殊转场效果等..."></textarea>
                </div>
                
                <button id="generateVideoBtn"><i class="fas fa-bolt"></i> 生成视频提示词</button>
                
                <div id="videoResultContainer" class="result-container">
                    <div class="result-header">
                        <h3><i class="fas fa-scroll"></i> 生成的视频提示词</h3>
                        <button id="copyVideoBtn" class="copy-btn"><i class="fas fa-copy"></i> 复制到剪贴板</button>
                    </div>
                    <textarea id="videoPromptResult" readonly></textarea>
                    <div id="videoCharCount" class="char-count">字数：0</div>
                    <div style="margin-top: 10px; font-size: 13px; color: #666;">
                        <strong>使用说明：</strong> 在AI视频生成工具中，先上传您的产品图片，然后将此提示词复制到描述框中。
                    </div>
                </div>
            </div>
        </div>
        
        <footer>
            <p><i class="fas fa-lightbulb"></i> 提示：专为电商设计，保持产品一致性，兼容即梦、Midjourney、Stable Diffusion、Runway等主流AI工具</p>
        </footer>
    </div>

    <!-- 安装提示 -->
    <div id="installPrompt">
        <p>将应用安装到设备以获得更好体验？</p>
        <button id="installAppBtn">安装应用</button>
        <button id="closeInstallPrompt">稍后再说</button>
    </div>

    <script>
        // 由于代码过长，这里只包含核心功能
        // 完整的JavaScript代码请参考之前的完整版本
        
        // 选项卡切换功能
        document.querySelectorAll('.tab').forEach(tab => {
            tab.addEventListener('click', function() {
                document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
                document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));
                
                this.classList.add('active');
                const tabId = this.getAttribute('data-tab');
                document.getElementById(`${tabId}-tab`).classList.add('active');
            });
        });

        // 填充示例函数
        function fillExample() {
            document.getElementById('productSubject').value = '陶瓷花瓶';
            alert('示例已填充！');
        }

        // 生成提示词 - 简化版
        document.getElementById('generateBtn').addEventListener('click', function() {
            const productSubject = document.getElementById('productSubject').value.trim();
            
            if (!productSubject) {
                alert('请输入产品主体！');
                return;
            }

            const style = document.getElementById('style').value || '默认风格';
            const composition = document.getElementById('composition').value || '默认构图';
            
            const prompt = `产品: ${productSubject}\n风格: ${style}\n构图: ${composition}\n\n完整提示词:\n${productSubject}, ${style}, ${composition}, professional product photography, high quality, commercial appeal`;
            
            document.getElementById('promptResult').value = prompt;
            document.getElementById('resultContainer').style.display = 'block';
        });

        // 复制功能
        document.getElementById('copyBtn').addEventListener('click', function() {
            const promptResult = document.getElementById('promptResult');
            promptResult.select();
            document.execCommand('copy');
            alert('已复制到剪贴板！');
        });

        // PWA功能
        if ('serviceWorker' in navigator) {
            window.addEventListener('load', function() {
                navigator.serviceWorker.register('sw.js')
                    .then(function(registration) {
                        console.log('ServiceWorker 注册成功');
                    })
                    .catch(function(error) {
                        console.log('ServiceWorker 注册失败');
                    });
            });
        }

        // 安装提示
        let deferredPrompt;
        const installPrompt = document.getElementById('installPrompt');

        window.addEventListener('beforeinstallprompt', (e) => {
            e.preventDefault();
            deferredPrompt = e;
            setTimeout(() => {
                installPrompt.style.display = 'block';
            }, 3000);
        });

        document.getElementById('installAppBtn').addEventListener('click', () => {
            installPrompt.style.display = 'none';
            deferredPrompt.prompt();
        });

        document.getElementById('closeInstallPrompt').addEventListener('click', () => {
            installPrompt.style.display = 'none';
        });
    </script>
</body>
</html>